/**
 * 
 */
package panda.planner;

import panda.syntax.*;
import panda.transaction.Transaction;

/**
 * The planner for update operations, such as <i>UPDATE</i>, <i>INSERT</i>
 * @author Tian Yuan
 *
 */
public interface UpdatePlanner {
	
	/**
	 * Execute the specific <i>INSERT</i> statement
	 * @param stm the specific statement
	 * @return the number of affected records
	 */
	public int executeInsertValues(ValuesInsertStm stm, Transaction tx);
	
	/**
	 * Execute the specific <i>DELETE</i> statement
	 * @param stm the specific statement
	 * @return the number of affected records
	 */
	public int executeDelete(DeleteStm stm, Transaction tx);
	
	/**
	 * Execute the specific <i>UPDATE</i> statement
	 * @param stm the specific statement
	 * @return the number of affected records
	 */
	public int executeModify(UpdateStm stm, Transaction tx);
	
	/**
	 * Execute the specific <i>CREATE TABLE</i> statement
	 * @param stm the specific statement
	 * @return the number of affected records
	 */
	public int executeCreateTable(CreateTableStm stm, Transaction tx);
	
	/**
	 * Execute the specific <i>DROP TABLE</i> statement
	 * @param stm the specific statement
	 * @return the number of affected records
	 */
	public int executeDropTable(DropTableStm stm, Transaction tx);
	
	/**
	 * Execute the specific <i>CREATE INDEX</i> statement
	 * @param stm the specific statement
	 * @return the number of affected records
	 */
	public int executeCreateIndex(CreateIndexStm stm, Transaction tx);
	
	/**
	 * Execute the specific <i>DROP INDEX</i> statement
	 * @param stm the specified statement
	 */
	public int executeDropIndex(DropIndexStm stm, Transaction tx);
}
